package com.miaosha.intelligence;

import java.util.Date;

import org.apache.http.client.methods.HttpGet;
import org.apache.log4j.Logger;

import com.miaosha.MediaService;
import com.utils.DateUtil;

/**
 * 智能秒杀
 * @author TANGJZ2
 *
 */
public class IntelligenceSeckill {
	public static Logger logger = Logger.getLogger(IntelligenceSeckill.class);

	public static void main(String[] params) throws Exception{

		Date startTime = DateUtil.parse(DateUtil.format(new Date(), "yyyy-MM-dd") + " " + params[2], "yyyy-MM-dd HH:mm:ss.S");
		MediaService.login(params[0], params[1]);
		MediaService.sign();
		String couponId = MediaService.getCouponId();
		HttpGet httpGet = new HttpGet(MediaService.MIAOSHA_URL + couponId);
		
		
		
		MediaService.createSchedule(startTime, httpGet);
	}

}
